
cc.Class({
    extends: cc.Component,

    properties: {
        clickLook: cc.Button,
        time: cc.Label
       
    },

    onLoad () {
        this.init()
    },

    init(){
        this.node.zIndex = 3
        this.num = 5
        this.time.string = this.num
        this.isDie = true
    },

    start () {
        this.schedule(function() {
            if(this.num > 0){
                this.num--
                this.time.string = this.num
            }
            if(this.isDie && this.num <= 0){
                this.node.active = false
                this.init()
                game.jGameOver.over(false)
                cc.audioEngine.pause(game.bgmId)
                this.hreoDieId = cc.audioEngine.play(game.hreoDie, false, 1);
            }
        }, 1);
    },

    lookAd(){
        cc.audioEngine.pause(game.bgmId)
        this.node.active = false
        this.init()
        game.ad.active = true
    }



});
